#include "key.h"

#define KEY1 HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_0)
#define KEY2 HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1)
#define KEY3 HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_2)
#define KEY4 HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0)
#define KEY_Port (KEY1) | (KEY2 << 1) |(KEY3 << 2) |(KEY4 << 3) | 0xf0

uint8_t Trg;
uint8_t con;
void Key_Read(void)
{
	uint8_t read;
	read = (KEY_Port) ^ 0xff;
	Trg = read & (con ^ read);
	con = read;
}

